<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>登录</title>
    <link type="text/css" rel="stylesheet" th:href="@{/css/login.css}"/>
    <script type="text/javascript" th:src="@{/js/jquery-1.11.1.min.js}"></script>
    <script type="text/javascript">
        // $(document).ready(function () {
        // 	var height=$(document).height();
        // 	$('.main').css('height',height);
        // })
        $(function () {
            $("#ulogin").on('click', function () {
                var data = $("form").serialize();
                // alert(data)
                $.ajax({
                    url: "user/login",
                    type: "post",
                    data: data,
                    success: function (resp) {
                        // alert(resp)
                        if (resp == 1) {
                            alert("ss")
                            location.href = "/index"
                        } else {
                            alert("错误")
                        }
                    }
                })
            })


            // $('#ulogin').click(function(){
            //     alert("ss")
            //     var data = $("form").serialize(); // 表单序列化
            //     $.ajax( {
            //         type : 'POST',
            //         url : 'user/login',
            //         data : data,
            //         dataType:"json",
            //         success : function(msg) {
            //             alert(msg);
            //         }
            //     });
            // });
        })

    </script>
    <script>
        $(document).ready(function () {
            $("#footer").load("jump?url=common/footer0")
        })
    </script>
</head>

<body>
<div class="main">
    <div class="main0">
        <div class="main_left">
            <img th:src="@{/images/login-image-3.png}" class="theimg"/>
            <img th:src="@{/images/login-image-2.png}" class="secimg"/>
            <img th:src="@{/images/login-image-1.png}" class="firimg"/>
        </div>
        <div class="main_right">
            <div class="main_r_up">
                <img th:src="@{/images/user.png}"/>
                <div class="pp">登录</div>
            </div>
            <div class="sub"><p>还没有账号？<a href="zhuce2.html"><span class="blue">立即注册</span></a></p></div>
            <form method="post" id="uform">
                <div class="txt">
                    <span style="letter-spacing:8px;">用户名:</span>
                    <input name="userName" type="text" class="txtphone" placeholder="请输入注册手机号或用户名"/>
                </div>
                <div class="txt">
                    <span style="letter-spacing:4px;">登录密码:</span>
                    <input name="password" type="text" class="txtphone" placeholder="请输入登录密码"/>
                </div>
                <div class="txt">
                    <span style=" float:left;letter-spacing:8px;">验证码:</span>
                    <input name="" type="text" class="txtyzm" placeholder="请输入页面验证码"/>
                    <img src="images/yanzhengma.png" class="yzmimg"/>
                </div>
                <div class="xieyi">
                    <input name="" type="checkbox" value="" checked="checked"/>
                    记住我 <a href="password.html"><span class="blue"
                                                      style=" padding-left:130px; cursor:pointer">忘记密码?</span></a>
                </div>
                <!--          <div class="xiayibu">登录</div>-->
                <input id="ulogin" type="button" class="xiayibu" value="登录"/>
            </form>
        </div>
    </div>
</div>

<div id="footer"></div>
</body>
</html>
